home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95c.txt / 000090_icon-group-sender _Wed Nov 22 13:12:00 1995.msg < prev    next >
Internet Message Format  |  1996-01-03  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 22 Nov 1995 12:26:50 MST
  2. Message-Id: <9511221312.AA17401@ns1.computek.net>
  3. Mime-Version: 1.0
  4. Content-Length: 932
  5. Content-Type: text/plain
  6. Content-Transfer-Encoding: 7bit
  7. Date: Wed, 22 Nov 95 13:12 CST
  8. From: gep2@computek.net
  9. Subject: Parsing structured text
  10. To: icon-group@cs.arizona.edu
  11. X-Mailer: SPRY Mail Version: 04.00.06.17
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13.  
  14. >Are there any general techniques for parsing text (and structured
  15. text in particular) that may be spread over several lines, e.g. HTML
  16. or LaTeX files? Most examples in the Icon book (1st edition) assume
  17. that the input can be dealt with a line at a time. What approach
  18. should I take when dealing with structured text, such as HTML or
  19. LaTeX, in which the entities to be parsed may be embedded inside
  20. other entities and may extend over several lines? 
  21.  
  22. Personally, the approach I tend to use in most cases like this is to create a 
  23. super-line which consists of (say) three or four adjacent lines concatenated 
  24. together.  This way, I have the whole construct I want to parse in one string.
  25.  
  26. On the other hand, if you have constructs that are several pages separated from 
  27. each other, that sorta calls for alternative approaches, outside the scope of a 
  28. mailing list posting.  :-)
  29.  
  30. Gordon Peterson
  31. http://www.computek.net/public/gep2/
  32.  
  33.